/*
 * RadioButtonDelegate.h  0.4.0 / Dec 05, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef RADIOBUTTONDELEGATE_H
#define RADIOBUTTONDELEGATE_H

#include "Cute4jSwing.h"

#include "ToggleButtonDelegate.h"

// RadioButtonDelegate Class. --------------------------------------------------

/*!
 * \brief RadioButton Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT RadioButtonDelegate : public ToggleButtonDelegate
{
  Q_OBJECT
protected:
  RadioButtonDelegate(JNIEnv *env, jobject obj);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QRadioButton *qRadioButton() const;
};

// RadioButtonDelegate :: Inline Member Function. ------------------------------

/*!
 * \brief Returns QRadioButton adaptee.
 *
 * \return QRadioButton adaptee
 */
inline QRadioButton *RadioButtonDelegate::qRadioButton() const
{
  return static_cast<QRadioButton *>(qObject());
}

// Macro Definition. -----------------------------------------------------------

#define RADIO_BUTTON_DELEGATE \
    (reinterpret_cast<RadioButtonDelegate *>(delegate))

#endif // RADIOBUTTONDELEGATE_H
